package com.econ.powercloud.ems.common.enums;

/**
 * @ Description:
 * @ Author：hgp
 * @ Create:2022-11-25-14:18
 */
public enum ComputeModel {

    SPC(1,"SPC",ComputeType.ADD.getCode(),"站用电量"),
    EON(2,"EON",ComputeType.STARTTIME.getCode(),"上网电量"),
    EOFF(3,"EOFF",ComputeType.ADD.getCode(),"下网电量"),
    UTH(4,"UTH",ComputeType.DIVISION.getCode(),"电站运行时长"),
    EAF(5,"EAF",ComputeType.DIVISION.getCode(),"电站等效利用系数"),
    EESS(6,"EESS",ComputeType.DIVISION.getCode(),"电站综合效率"),
    RES(7,"RES",ComputeType.SUBTRACT.getCode(),"电站储能损耗率"),
    RS(8,"RS",ComputeType.DIVISION.getCode(),"站用电率"),
    ESU(9,"ESU",ComputeType.DIVISION.getCode(),"充放电能转换效率"),
    POF(10,"POF",ComputeType.DIVISION.getCode(),"计划停运系数"),
    UOF(11,"UOF",ComputeType.DIVISION.getCode(),"非计划停运系数"),
    AF(12,"AF",ComputeType.DIVISION.getCode(),"电站可用系数"),
    UTF(13,"UTF",ComputeType.DIVISION.getCode(),"电站利用系数"),
    SROPSDR(14,"SROPSDR",ComputeType.DIVISION.getCode(),"电站调度响应成功率"),
    ACCOTPS(15,"ACCOTPS",ComputeType.STARTTIME.getCode(),"电站实际可充放电功率"),
    ADCOTPS(16,"ADCOTPS",ComputeType.STARTTIME.getCode(),"电站实际可放电量"),
    S(17, "S", ComputeType.ADD.getCode(), "运行评价总分"),
    UOH(18, "UOH", ComputeType.DIVISION.getCode(), "电站非计划停运（停机）时长"),

    PI(50,"PI",ComputeType.MULTIPLICATION.getCode(),"储能单元额定功率*运行时长"),
    PN(51,"PN",ComputeType.ADD.getCode(),"累计储能单元额定功率*运行时长"),
    EAFI(52,"EAFI",ComputeType.ADD.getCode(),"储能单元等效利用系数"),
    UOHI(53,"UOHI",ComputeType.MULTIPLICATION.getCode(),"储能单元额定功率*停机时长"),
    UOHN(54,"UOHN",ComputeType.ADD.getCode(),"累计储能单元额定功率*停机时长"),
    ;

    private Integer code;
    private String model;
    private Integer cal;
    private String desc;

    public Integer getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public String getModel(){return model;}

    public Integer getCal(){return cal;}

    ComputeModel(Integer code, String model, Integer cal, String desc){
        this.code=code;
        this.model = model;
        this.cal = cal;
        this.desc=desc;
    }

    public static ComputeModel fromCode(Integer code){
        for(ComputeModel type: ComputeModel.values()){
            if(type.getCode().equals(code)){
                return type;
            }
        }
        return null;
    }

    public static ComputeModel fromModel(String model){
        for(ComputeModel type: ComputeModel.values()){
            if(type.getModel().equals(model)){
                return type;
            }
        }
        return null;
    }
}
